﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TTEngine
{
    public enum Platform
    {
        None,
        Windows64,
        Editor_Windows64,
    }
    public static class Environment
    {

        //资源路径
        public static string AssetsPath
        {
            get;
            private set;
        }
        public static string StreamingAssetsPath
        {
            get;
            private set;
        }
        //持久化路径
        public static string PersistentPath
        {
            get;
            private set;
        }
        public static bool IsEditor
        {
            get
            {
                return Platform == Platform.Editor_Windows64;
            }
        }
        public static Platform Platform
        {
            get;
            private set;
        }
        public static AssetPlatform AssetPlatform
        {
            get;
            private set;
        }
        public static void Init(Platform platform, string startPath)
        {

            if (platform == Platform.Windows64)
            {
                var fullpath = System.IO.Path.GetFullPath(startPath);
                AssetsPath = fullpath + "\\assets";
                StreamingAssetsPath = fullpath + "\\streammingassets";
                PersistentPath = fullpath + "\\savedpath";
                AssetPlatform = AssetPlatform.Windows;
            }
            else if (platform == Platform.Editor_Windows64)
            {
                var fullpath = System.IO.Path.GetFullPath(startPath);
                AssetsPath = fullpath + "\\assets";
                StreamingAssetsPath = fullpath + "\\streammingassets";
                PersistentPath = fullpath + "\\savedpath";
                AssetPlatform = AssetPlatform.Windows;
            }

            AssetMgr.RegAssetPacker(new Texture2DPacker());
        }
    }
}
